﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Initialize.aspx.cs" Inherits="Initialize" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<body>
    <form id="InitializeForm" runat="server">
        <div>
            <asp:ScriptManager runat="server" ID="InitializeScriptManager" />
            <asp:UpdatePanel runat="server" ID="_AjaxPanel">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="ServConnectionBtn" />
                    <asp:AsyncPostBackTrigger ControlID="WebConfigChanged" />
                </Triggers>
                <ContentTemplate>
                    <div style="text-align: center; color: green; height: 30px;">
                        <asp:Label ID="ServStatusLab" runat="server" Text=""></asp:Label>
                    </div>
                </ContentTemplate>
            </asp:UpdatePanel>
            <table style="font-size: 12px; margin: 20px auto; border: 1px solid black;">
                <tr>
                    <td colspan="7" style="text-align: center; font-size: 18px;">连接数据库</td>
                </tr>
                <tr style="text-align: right;">
                    <td style="width: 100px;">数据库地址：</td>
                    <td>
                        <asp:TextBox ID="ServIP" runat="server"></asp:TextBox>
                    </td>
                    <td style="width: 100px;">用户名：</td>
                    <td>
                        <asp:TextBox ID="ServUsr" runat="server"></asp:TextBox>
                    </td>
                    <td style="width: 100px;">密码：</td>
                    <td>
                        <asp:TextBox ID="ServPwd" runat="server"></asp:TextBox>
                    </td>
                    <td style="text-align: center;">
                        <asp:Button ID="ServConnectionBtn" runat="server" Text="连接" OnClick="ServConnectionBtn_Click" />
                    </td>
                </tr>
                <tr>
                    <td colspan="7" style="text-align: center; font-size: 18px;">数据库操作</td>
                </tr>
                <tr>
                    <td colspan="2" style="text-align: center;">选择SQL脚本文件：</td>
                    <td colspan="4">
                        <asp:FileUpload ID="SQLFileUpl" runat="server" Width="100%" />
                    </td>
                    <td style="text-align: center;">
                        <asp:Button ID="ServActiveBtn" runat="server" Text="导入SQL脚本" OnClick="ServActiveBtn_Click" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2" style="text-align: center;">数据库连接字串：</td>
                    <td>
                        <asp:TextBox ID="ConnectionKey" runat="server" /></td>
                    <td colspan="3">
                        <asp:TextBox ID="ServSqlConnection" runat="server" Width="100%"></asp:TextBox>
                    </td>
                    <td style="text-align: center;">
                        <asp:Button ID="WebConfigChanged" runat="server" Text="修改Web.Config" OnClick="WebConfigChanged_Click" />
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>
